package com.brewdroid.model;


public class IngredientStep {
	
	private final String dots="---------------------------------------";
	
	private double quantity;
	
	private String unitType;
	
	private Ingredient ingredient;
	
	public Ingredient getIngredient() {
		return ingredient;
	}

	//default constructor needed for ormlite persistance
	public IngredientStep(){

	}
	
	@Override
	public String toString(){
		
		StringBuilder sb= new StringBuilder();
		sb.append("\n"+dots+"\n");
		//todo substring this
		String ty=ingredient.getClass().getName();
		String[] clzAr=ty.split("\\.");
		sb.append("Type: "+clzAr[(clzAr.length-1)]+"\n");
		sb.append(ingredient.toString());
		sb.append("Quantity: "+ Double.toString(quantity)+"\n");
		sb.append("Units: "+unitType+"\n");
		sb.append(dots + "\n");
		
		return sb.toString();
	}
	
	public void setIngredient(Ingredient ingredients) {
		this.ingredient = ingredients;
	}
	

	public double getQuantity() {
		return quantity;
	}

	public void setQuantity(double quantity) {
		this.quantity = quantity;
	}

	public String getUnitType() {
		return unitType;
	}

	public void setUnitType(String unitType) {
		this.unitType = unitType;
	}

}
